package cate.game.play.skill.passive.furniture;

import cate.game.play.config.PlayCfgArgs;
import cate.game.play.fighter.Fighter;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;
import easy.java.struct.ref.DoubleRef;

/**
 * 无视8%受到的伤害并将该次伤害的15%转化为自身生命值
 */
public class 伤害无视PH extends PassiveHandler {

	private double 无视系数;

	private double 转化系数;

	//无视系数=800&转化系数=1500
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		无视系数 = args.getWDouble("无视系数", 0d);
		转化系数 = args.getWDouble("转化系数", 0d);
	}

	@Override
	public void adjustSkillDamage(ActionCtx action, Fighter actor, int reason, DoubleRef doubleRef) {
		double ignDamage = doubleRef.v * 无视系数;
		doubleRef.v -= ignDamage;
		double heal = ignDamage * 转化系数;
		skill.owner.attr.passiveHeal(action, heal);
	}
}
